/*
 * @Author: KKKKKK
 * @Date: 2021-01-10 12:08:53
 * @LastEditors: KKKKKK
 * @LastEditTime: 2021-01-10 12:08:54
 */
import axios from './config'
import url from './url'
const baseUrl = process.env.VUE_APP_BASE_URL


// 用户管理
// 新增用户
const userCreate= (params) => axios.post(baseUrl + url.user.create, params)

// 删除用户
const userDelete = (params) => axios.delete(baseUrl + url.user.deletes, { params })

// 修改用户
const userUpdate = (params, id) => axios.post(baseUrl + url.user.update + `/${id}`, params)

// 获取某个用户
const userLoad = (id) => axios.get(baseUrl + url.user.load + `/${id}`)

// 获取用户列表
const userPage = (params) => axios.get(baseUrl + url.user.page, { params })

// 验证用户是否存在
const userCheck = (params) => axios.get(baseUrl + url.user.checkuser, { params })

export default {
  userCreate,
  userDelete,
  userUpdate,
  userLoad,
  userPage,
  userCheck
}
